package en.edu.scau.cmi.zhanzhiyong.carpter04;

import java.util.Scanner;

public class yanghui_triangle {
	public static void main(String[] args) {
		
		int[][] arr = new int[100][100];
		
		int N;
		Scanner reader = new Scanner(System.in);
		
		N = reader.nextInt();
		
		arr[0][0] = 1;
		
		for(int i = 0;i <= N;i++) {
			for(int j = 0;j <= i;j++) {
				
				if(j == 0 || j == i) {
					arr[i][j] = 1;
				}else {
					arr[i][j] = arr[i-1][j] + arr[i-1][j-1];
				}
			}
		}
		
		for(int i = 0;i <= N;i++) {
			for(int j = 0;j <= i;j++) {
				System.out.print(arr[i][j]+"  ");
			}
			
			System.out.println();
		}
	}
}
